#ifndef ARGS_H
#define ARGS_H
#include <QVector>
#include <QColor>
#include "..\DataManipulator\datamanipulator.h"
//enum controllerState
//{
//	OpenProjectSucceed,
//	OpenProjectFailed,
//	CreateProjectSucceed,
//	CreateProjectFailed
//
//};
enum PointType
{
	Plinear,
	Psmooth,
	Psymmetrical,
	Psharp
};
enum GradientType
{
	LinearGradient,
	RadialGradient
};
enum MessageType
{
    messages,
    createNewProjectMessage,
    selectContainerMessage,
    selectObjectsMessage,
    cancleCurrentEditObjectMessage,
    setPropertyValueMessage,
    newNodeMessage,
    undoMessage,
    redoMessage,
    deleteNodeMessage,
	saveMessage,
	generateJsMessage,
    openProjectMessage,
	closeProjectMessage,
	setStaticPropertyMessage,
	addPointMessage,
	//endCurveEditMessage,
	nodeConvertMessage,
	swapLayerMessage,
	movePointMessage,
	deletePointMessage,
	changePointTypeMessage,
	setGradientMessage
};
enum staticPropertyType
{
	lineColor,
	lineWidth,
	fillColor,
	nodeName,
	wordFont,
	wordContent
};
enum curvePointType
{
	curvePoint,
	LcontrolPoint,
	RcontrolPoint
};
class MovePointArgs
{
public:
	QPointF oriPoint;
	QPointF newPoint;
	curvePointType pointtype;
	int index;
	MovePointArgs()
	{
	}
	~MovePointArgs()
	{
	}
	MovePointArgs(QPointF op,QPointF np):oriPoint(op),newPoint(np)
	{
		index=-3;
	}
	MovePointArgs(curvePointType tp,int inx,QPointF np):pointtype(tp),index(inx),newPoint(np)
	{

	}

};
class AddPointArgs
{
public:
	PointType pointType;
	QPointF point;
	QPointF LCpoint;
	AddPointArgs()
	{
	}
	~AddPointArgs()
	{
	}
	AddPointArgs(PointType pt,QPointF p):pointType(pt),point(p)
	{
	}
	AddPointArgs(PointType pt,QPointF p,QPointF cp):pointType(pt),point(p),LCpoint(cp)
	{
	}

};
class SetStaticProperArgs
{
public:
	staticPropertyType sType;
	QColor linecolor;
	QColor fillcolor;
	double linewidth;
	QString nodename;
	QFont wordfont;
	QString wordcontent;
	SetStaticProperArgs()
	{
	}
	SetStaticProperArgs(staticPropertyType st,QColor color):sType(st)
	{
		if(st==lineColor)
			linecolor=color;
		if(st==fillColor)
			fillcolor=color;
	}
	SetStaticProperArgs(staticPropertyType st,QString astring):sType(st)
	{
		if(st==nodeName)
			nodename=astring;
		if(st==wordContent)
			wordcontent=astring;
	}
	SetStaticProperArgs(staticPropertyType st,QFont f):sType(st),wordfont(f)
	{
	}
};

class nodePath
{
public:
    QVector<int> path;
	nodePath():path()
	{
	}
    nodePath(QVector<int> p):path(p)
    {

    }
    ~nodePath()
    {

    }
};
class NewProjectArgs
{
   public:
    int width;
    int height;
    QColor bkcolor;
    int fps; 
    QString name;
	NewProjectArgs()
	{
	}
    NewProjectArgs(QString n,int w,int h,QColor bk,int f):name(n),width(w),height(h),bkcolor(bk),fps(f)
    {

    }
    ~NewProjectArgs()
    {

    }
};




class SelectObjectsArgs
{
public :
    QVector<int> selectedIndex;
	SelectObjectsArgs()
	{
	}
	SelectObjectsArgs(int index):selectedIndex(QVector<int>())
	{
		selectedIndex.push_back(index);

	}
    SelectObjectsArgs(QVector<int> in):selectedIndex(in)
    {
    }
    ~SelectObjectsArgs()
    {

    }

};



//enum propertyType
//{
//    posx,posy,scalex,scaley,axisx,axisy,skewx,skewy,angle,alpha,visible
//};
typedef Ease::EaseType easeType;

//enum easeType
//{
//    AllStart,
//    AllEnd,
//    Linear
//};
//enum changeType
//{
  //  Value,
   // Time,
   // Ease
//};

class SetArgs
{
public :
    propertyType propertype;
    double value;
    double time;
    easeType ease;
    //QVector<changeType>change;
	SetArgs()
	{
	}
	SetArgs(propertyType p,double v=0,double t=0,easeType e=Ease::Linear):propertype(p),value(v),time(t),ease(e)
    {

    }
    ~SetArgs()
    {

    }

};

enum NodeType
{
    movieClipNode,
    pictureNode,
    recNode,
    pathNode,
    wordShapNode,
    eclipseNode

};

class NewNodeArgs
{
public:
    NodeType nodetype;
    nodePath parentPath;
    QPointF position;
    QVector<QPointF> pointsForPathNode;
    QString UrlForPicNode;
	QString wordContent;
	double width;
	double height;
	int argsType;
	QFont font;
	NewNodeArgs()
	{argsType=0;
	}
	 NewNodeArgs(NodeType n,nodePath in,QPointF po):nodetype(n),parentPath(in),position(po)
    {
		argsType=1;
    }
	 NewNodeArgs(NodeType n,nodePath in,QPointF po,double w,double h):nodetype(n),parentPath(in),position(po),width(w),height(h)
    {
		argsType=1;
    }
	  NewNodeArgs(NodeType n,nodePath in,QPointF po,QVector<QPointF> qps):nodetype(n),parentPath(in),position(po),pointsForPathNode(qps)
    {
		argsType=2;
    }
     NewNodeArgs(NodeType n,nodePath in,QPointF po,QString word,QFont f):nodetype(n),parentPath(in),position(po),wordContent(word),font(f)
	 {
		 argsType=2;
	 }
	NewNodeArgs(NodeType n,nodePath in,QPointF po,QString path):nodetype(n),parentPath(in),position(po)
    {
		argsType=3;
		if(n==wordShapNode)
	   {
	      wordContent=path;
		  font=QFont();
	   }
		else
	  {
	    UrlForPicNode=path;
	  }
	  

    }
	 NewNodeArgs(NodeType n,QPointF po):nodetype(n),position(po)
    {
		argsType=4;
    }
	 NewNodeArgs(NodeType n,QPointF po,double w,double h):nodetype(n),position(po),width(w),height(h)
    {
		argsType=4;
    }
	  NewNodeArgs(NodeType n,QPointF po,QVector<QPointF> qps):nodetype(n),position(po),pointsForPathNode(qps)
    {
		argsType=4;
    }
	   NewNodeArgs(NodeType n,QPointF po,QString word,QFont f):nodetype(n),position(po),wordContent(word),font(f)
	 {
		 argsType=4;
	 }
	NewNodeArgs(NodeType n,QPointF po,QString path):nodetype(n),position(po)
    {
		argsType=4;
		if(n==wordShapNode)
	   {
	      wordContent=path;
		  font=QFont();
	   }
		else
	  {
	    UrlForPicNode=path;
	  }
	  

    }
    ~NewNodeArgs()
    {

    }
};
class OpenProjectArgs
{
public:
    QString openPath;
    QString openName;
    OpenProjectArgs()
	{
	}
    OpenProjectArgs(QString path,QString na):openPath(path),openName(na)
	{
	}
    ~OpenProjectArgs()
	{
	}
};

class ChangePointTypeArgs
{
public:
	int index;
	PointType destType;
	ChangePointTypeArgs()
	{
	}
	~ChangePointTypeArgs()
	{
	}
	ChangePointTypeArgs(int i,PointType de):index(i),destType(de)
	{
	}
};
class SetGradientArgs
{
public:
	GradientType gType;
	QPointF startPoint;
	QPointF endPoint;
	QPointF centralPoint;
	double cradius;
	double fradius;
	QPointF focusPoint;
	QVector<double> setPoint;
	QVector<QColor> setColor;
	SetGradientArgs(){}
	~SetGradientArgs(){}
	SetGradientArgs(GradientType g,QPointF sp,QPointF ep,QVector<double> setpoint,QVector<QColor> sc):gType(g),startPoint(sp),endPoint(ep),setPoint(setpoint),setColor(sc){}
	SetGradientArgs(GradientType g,QPointF cp,double cr,double fr,QPointF fp,QVector<double> setpoint,QVector<QColor> sc):gType(g),centralPoint(cp),cradius(cr),fradius(fr),focusPoint(fp),setPoint(setpoint),setColor(sc){}
};
#endif
